added first version of code