Added crucial head pat funcitonality