Cleaned up all of the code, finalized it