added first pieces of itemcosine method