updated according to Brivio suggestions