Adapted code to the proper coding style.