add time measurement code
add time measurement code
small performance improv
small performance improv
small performance improv