first version of code