functions for processing data and creating combined trials page..