Much easier solution in py. No need to create class...