added preprocessing