removed unused import and added function to plot histogram of deviations
made deviation function more generic so that it can calculate deviations of averages as well