updated script for debugging