Added FormatChart and PrepCast functions.