solve some bugs about calculate. add gitignore. changed the way it works and some improvements