Deleted double lines, added function comments.