a newer version of this

cleaned up some old stinky code