More battery work, algorithm semi-working