Added some defines, removet bit manipulation functions, added speed set function.