implemented request() algorithm