factorial html duplicated in .js