removed alerts + added comments to .js