bugfixes + adding comments