cleaned up some variable placement