merged changes from james crowley