preliminary work on new and improved head finding script