Fixed erros so code is ready to compile