Use long to avoid problem with max int size