handle most of plane. fixed some bugs that didn't arise in earlier testing