Update python beta-extraction code. Will be beautiful.