divided the main function to different screen