add first version of working logic