added grouptype insert
removed commented code
footer id error
error message improved
initalised grouptype
formatting