Several updates to the code including more configurability and comments