added simpler single-resource implementation