added calculation of distance and angles