Updated to include additional comments and fixes to work with Lucy