refactored and added code to diaplsy mood pie graph