working version
add scalajs pickling