finished up script for new 3d plot