lab 6(needs class overloading)