value packets fixed and code cleaned a bit more