Incroporate if statements to get_references