Added and fixed code