added in a macro to measure execution time
get rid of applies