Changed a few things around and added some more documentation