cleaned up some stuff, fixed mid2long's decode