added initial python implementation