redifining figure generating code at end of script for dates and speed