Completed authentication
	Tidy up code