<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compareBIMfiles(beforeFileName, afterFileName, outputFileName):
 """Compare two BIM files for differences. :param beforeFileName: the name of the file before modification. :param afterFileName: the name of the file after modification. :param outputFileName: the name of the output file (containing the differences between the ``before`` and the ``after`` files. :type beforeFileName: str :type afterFileName: str :type outputFileName: str :returns: the number of differences between the two files. The ``bim`` files contain the list of markers in a given dataset. The ``before`` file should have more markers than the ``after`` file. The ``after`` file should be a subset of the markers in the ``before`` file. """

    # Creating the options
    options = Dummy()
    options.before = beforeFileName
    options.after = afterFileName
    options.out = outputFileName

    # Checking the options
    CompareBIM.checkArgs(options)

    # Reading the BIM files
    beforeBIM = CompareBIM.readBIM(options.before)
    afterBIM = CompareBIM.readBIM(options.after)

    # Finding the differences
    CompareBIM.compareSNPs(beforeBIM, afterBIM, options.out)

    return beforeBIM - afterBIM