Cleaned up append and added unit tests