Formatted and cleaned code