refactored head; fixed id