Merge pull request #3 from khaledhosny/master

Simplify the python code