Formatted code

Also removed unused imports, suppressed warnings where needed