Ch6 ex 1-3 implemented