Added discharge functionality to front-end