functions for UI written