This entire code addition needs some inline docs added for the annotated source code.