cleaned up the code and removed unneeded things