Initial commit

Publishing this code in case someone finds it useful.