added in code to print trial number and times