Cast x_beg, x_end, y_beg, y_end from int to size_t