merged with the thesis version