Added comments to frontend JS