a semi-functioning OO version