Added correct order of operations