testing utility function; need to revise it