Finished flagging routines, working on upgrading imaging programs