copied makedb to models