added battery to diagram, cleaned up code and diagram