Modified files with code from Mike