first gui code, by freholmd