updated person detection code