fixed some bugs, and removed some un-necessary imports