made it general and OO