Cleaned up a bit
Added some functions

And cleaned up a bit