added puts statements for debugging