Merge pull request #7 from leesdolphin/master

Added testing code
The segmentation fault was caused by my debugging statements.
Merge commit 'a418ecf6830bef9265f568a4d31644559073ad90'