Read from beginnning of buffer not from positon, that was giving me terrible headaches