There is a problem with if responsible for displaying 0 but nothing comes to my mind :(