tweaks to pyx code