replaced if statement syntax