Added saving by trial, legends and bugs fixed