STD and averages + fix of arraylist errors