added dumping on text file, fixed loop on BSP