traditional analytics code