fix frame flickering closes #2 - various cleanup