Added implementation for getHead