added first version of the code