Added another utility function...this should probably be cleaned up and merged into the existing one
with morefunctionality rather than having copies.