cleaned up the code and fixed some import problems