013 - Removed debug prints and minor optimisations