final eog code for demo