Full codebase for Frank et al. (2010), Cognition (messy)