changed order function