multi-line if statement fix and function rename