now g works, also fixed length -> len in sent_precheck routine