updated script from hiransuvrat