public Clip loadSound(String fileName) {
        Clip clip = null;
        URL url;

        // file directory relative to the file structure of the class
        url = frame.getClass().getResource(fileName);
        System.out.println(url);
        AudioInputStream audioIn = null;
        try {
            audioIn = AudioSystem.getAudioInputStream(url);
        } catch (UnsupportedAudioFileException e) {
            System.out.println("Error: " + e);
            e.printStackTrace();
        } catch (IOException e) {
            System.out.println("Error: " + e);
            e.printStackTrace();
        }
        try {
            clip = AudioSystem.getClip();
        } catch (LineUnavailableException e) {
            System.out.println("Error: " + e);
            e.printStackTrace();
        }
        try {
            clip.open(audioIn);
        } catch (LineUnavailableException e) {
            System.out.println("Error: " + e);
            e.printStackTrace();
        } catch (IOException e) {
            System.out.println("Error: " + e);
            e.printStackTrace();
        }
        return clip;
    }