Reformated code + fixed some mistakes in comments