adjusted implementation