better caching.. updated API for fit.py