Corrected mistakes so that it can compile