Added more documentation, so others can make sense of my code as well