trying to minimize JavaScript commands when selecting and deleting positions