Previous update now with working if statement