2013-10-29. Tony Wang. Add method for reading DB to create alg input