Updated to use arc. Added checking for valid tones to prevent out of bounds exception.