Added head and pegman() function