Fixed minor issues and documented functionality