Adding comments and bugfixes