making progress on python solution