form with nested functions