Define Key better
rootToInterval takes key quality
applyInterval works properly and handles all cases