using arrays and OOP