variables finally working correctly.