small modification according to comments