first version of the directive. It seems to work pretty well