Cleaned up debugging puts statements, renamed methods. Fixed a one-off bug