updated script to work with full codebase