Implements distance handling methods

Fix #32