rewrites the avg_price function to be smaller and adds more test cases