Bug fix, plus implementation of append function