updated according to comments