Takes in elements and calculates ratio in code