change len to int in speedinit