full but buggy Peek implementation