commented code, remade code for Qt

added my comments to my original code
made a QString version of my code since it broke with Qt