Completely reworking the script