Cleaned up imports, removed unused code, added more comments