improved performance
working on exporting function