Added comments, deleted unnecessary blocks