fixed setN
implemented a communication an position scheme
added double buffering