Some errors corrected and some TODO commented