Merged Scott's work in with mine.

Chart and logout functions both work.