minor changes (comments, removed unused vars)
added banal errormessage output