Revamped the entire script.