adding control flow