add beginning and end