Osx

@albertogaitan this is for you. Check out my comments here.
I try not to have code that gets executed outside of functions or the `if __name__ == '__main__'` construct. No reason this couldn't be done later in the script.