pretty large step, added departure detection, debugged. seems working