updated routines for martin's data