put works now
cleaned up debugging statements. added comments
fixed indentation