fixed comments, removed unnecessary functions, fixed output status