add q and some cleaning / comments