Fixed a compiler error, added more documentation