This code works perfect for A functionality, however, it wasn't until I put in a freshly charged battery