added some timing code. probably remove this for release.