more function tweaks