cleaned up debugging puts and fixed some indentation