use dynamic variables for current_x and current_y