implmeneted the spidr function