added speed conversion code and tests