Ensured that values are capped to avoid overflow error