implement premoves - and refactor pretty much the whole thing