Changed variable handling to tuples