alternative python solution