Added more bug fixed from professors code.