changed some errors in the code