code of initial version