full working version (to test as dependency)