add markdown editor; fix couple of bugs