began function, created if statement within function