Code review complete

Ready for submission to ICLR
