updated the code to use a plane