Added more documentation and small fixes