Added function for adding interval.