working first half version of the cookie