Fixed non method heap size, refactoring, added comments