enhanced with open-close and sample