Fixed some errors and reformated a bit