improve alg. of Jpickle