Made a few changes and add some options