moar bug fixes, removed debug prints