added a lot more documentation