revived some old code