Added a few things
The code needs to be cleaned up, but at least it works