adding the $has_headers boolean variable to the parse method