Added code to Assignment1_8, created required functions