rename things gooder; add some error checking