Almost done, but should add null support.