tested using different values of r