using cycle insted of code when bulk creating intervals