Updated with account manager and AI function.

Still needs testing.