wrote it in python instead of bash!