added python 3 support

This will support both python 2 & 3 syntax.