Merge with Dima, some unfinished stuff