converted script to py