added range and sum solution