added a readme and slightly tweak the code to improve usability