Cleaned up the code, removed unnecessary things