first implementation with random errors: TODO: get a good error
estimation