Simplified code and adjusted formatting
Updated IntelliJ project