Fixed script and made CSS more persistent

Works flawlessly except for some pre-existing issues with the sorting.