Trial-Based Functionality

This version is specific to my experiment.
Updated Source File