Slight cleanup of calculations, also faster array copy being used now