adding first version of the code