base code from 2012 year, updated for latest tools