Changed behaviour of bufferPos. Now it starts with 0. Much easier to understanding.