changed to a more cross-python compatible solution

Worked on 2.7 anyhow. :grin: