python 3.2 -> 3.4
move all dot code within function