GUI setup, grid diagram functions (no classes)