minor bug fix in cross correlate
go easy son
added clunky optimise() function