added intermediate variable