Fixed address function, had some variable issues