Code working and giving sensible outputs!