added some check for init val
partially rewrite test-decl