the first version of implementation