cleaned up head.cpp