code tweaks for latest library; implemented latest library