For the Lab 11 part of CS251 project