code now correctly builds spikes database