code for UI part