Migrate distance model to support decimal numbers