cleaned up, started implementing simple threshold model