marrying type-selector in ui with calculation