jQuery chaining
Organized the code into smaller functions
Updated dist