Remove prints and refactor isCollectable
Fix indentation and trailing whitespace

Sorry for the conflicts =(.