removed empty space and added function comments