updated database script.
More debugging on the learning code
more changes to learning code