removed junk and commented debug prints for speed