Added int cast
Added debug statement