why do you discard the static_cast?  there might be warnings here. We added the static_cast<int> to get ride of the implicit type conversion.