updated accordingly to comments