Actually probably works now. This class is still not tested.