cleaned up Python strategy code