Using the input as a guide, modify the following Python code to add a new feature of sorting the dictionary by value.
names_and_points = {
  "Dave": 20,
  "John": 40,
  "Rachel": 55
}
from operator import itemgetter

names_and_points = {
  "Dave": 20,
  "John": 40,
  "Rachel": 55
}

sorted_dict = sorted(names_and_points.items(), key=itemgetter(1))

print(sorted_dict)