new python solution