bug fixes
added relation builder, to fix bug in previous version of program