improved group parsing
added comments
improved behaviour
added new comments
cleaned up
refactored