added a new function that separates the space-finding from the header finding. This should help in the future