imports corrected and some other errors removed