implemented cook