adding debug boolean setting
tunning algorithms