Fixed some errors and changed comments a bit