added comments and quick fixes