ui changes, changed implementation of average