update function down, right, left