Removed debug message and reformatted code to best practice