Added smooth scroll, comments and improved formatting