Added default options for users
Also removed all trailing spaces and changed useage of die() to try/catch.