Better edge trigger

Drawing code still needs work.