first complete version of context initialization working and tested