https://gist.github.com/krotkiewicz/3134c608c91cddbf21e5#file-functioncalls2-py-L10