updated to work under CentOS 6
Included code necessary to run under CentOS 6