add utils.jl to encapsulate some common computational routines