Updated with some cleanups