Updated to match changes to core, added initial python implementation