added init, moved pickling method