Updated with Nicola's patch
Merge pull request #6 from pchengi/master

Updated with Nicola's patch