initial. not very DRY and needs work on debug flag, but generally works.
readme with simple -h flag