some timing code, removal of gradients begin