pre final version

please read the pdf file, check valgrid mem leaks, especially on errors
output_reshatot1.txt contains random outputs