fixed parseint bug and added comments