Made test and code for keeping distance