brought up to date with latest syntax and libraries