main ui coding