Added constructor and setoptions method