updating main file with Kevin's code