add some options and refactor
Merge pull request #45 from Saurabh7/gpregres

add some options and refactor