code changes in main for average prices