working on the heightAt function in terrain