thanks lookang and Prof. Hwang.  I implemented your changes and got it the way I wanted.  There is still a tiny error in the beginning but it does not affect any numbers.  thank you again for your continued help, and for helping to support EJS.  my EJS sims have become invaluable to student learning in my physics class.