gui code moved into engine