fixed compiler error. Appears to have loss of accuracy. Will investigate later.