being a slightly rethought version of the Frank implementation