moved JS code to external file, built pagination, and added scale transform