some script I wrote for a quick hack