add readme, fix bugs found from readme (sigh)