Worked on better method for finding variables