Revert "Update speed function"

This reverts commit 4036a6443323c7e462a63d569405557402d7dee5.