implemented builder (fixes issue #4)