added speed function and some doc