added functions to do phasing and time delays
converted everything from float to double for precision
badoutputs