fixed a bug in the code to get the occupancy, and in the plot of the GUI