Formatted code somewhat