Made changes to several codes