Added some documentation
Added a debug message for goals