Track class; frequencies calculation. Full of bugs to fix later