added generic move function