Ohshi code cleanup

cleaned up unused variables and tried to localize as many as i could