added prepending and appending tests, added immutable versions