done issue #9 (fixed construction from json)