added storage of last results and graphics max value for better plot

Signed-off-by: fabio <fbi.gritti@gmail.com>