write functions for mainPanel UI