turn constants into functions
add time function