added options and export function