Completed average application for assignment 4