uiutil to handle stuff like tgtToPos. Try to put most of ui.main out of global scope