Finished reworking homes code, hopefully it still works