Get apply working (I think), fix some stuff with map