cast Int to Long to avoid Int overflow