Made into a class, added adaptation