re-write atm_gui code