setInterval added and code formatted.