add beginning or ending option