reorder, some python fixes