added code for UI to function.. should be done.