add readme and modify main logic