finished rewrite of utilities