reformatted js with NOWDOC so it was readable