parse family string, added comments and error handling