Minor improvement python ver