complete contractParser, untested