implementation of equal interval