fixed up relationship and some of the routines