DK: improved the sample directive with configurable options.