(WORK IN PROGRESS) Re-implementing authentication