merging some old code