UCLA report #2: refactored code