add README, fix bugs
merge with master