Removed debug statements
Made chunk building more intelligent
Some style changes