Used generics to make the library easier to use. Only getDistance-implementation requires some sort of control for its input parameter now.