fixing more of mayhews code