my code seems to be working fine and i get the right output