Reviewed syntax and tested under Python v3.4.1