little refactor; snap to terrain