ported to the new c extension syntax