Original bad attempt at oop, and then the start of a new version