Improved the script (getting rid of a TODO)