bug fixing for full trials
working version