wrote the distance and transformed methods