moved some variable stuff around