Tweak parser algorithm to accomodate heads of any length