cleaned up code, fixed thresholds, possible turnin quality