fixed up some old code