added relationship setup and save functions