Added comments documentation
Fixed minor bugs