initial python solution