first working draft with minimal styling; TODO: gen cleanup,  control flow and UI improvements