Move selection works with number input, code cleanup