edits to fix segmentation faults
Merge pull request #43 from pradyu1993/master

edits to fix segmentation faults