fixed bug in Quick strings, general cleanup, added constant for N in main