main function done, writing UI