Python3 compatibility

Turns out that all it took was changing print to print() to make this Python 3 compatible. As written now, it's still backwards-compatible with Python 2 as well. This will resolve issue #23.
I'm curious about the mixed choice of if..return and elif..return here. Returning breaks you out of the function and so the conditional 'do only one of these' is redundant. What was the motivation?