Cleaned up JS, removed trailing whitespaces, removed each loop..