Added append, peek and fixed bugs