RF: grouped all code together to be well displayed on the web page.