Some functions added, UI functions improved