fixed typeError for multiple variables of same type, added missing require statements