Changes for assigment 4. All code is vectorized
exercise 5 final
Exercise 6 final
Exercise 7 final