REWRITE GUI and flow