updated according to M.H.'s comment