I haven't gone through much of your code to actually solve the asked problem (sorry), but if I understand the problem and code correctly it seems easier to write a specific object - such as Person -...