assignment2 for OOP