made some changes for better semantics
minor edits in atoi