finished greedy agent and added automated jpg creation