fixes and imported to IntelliJ IDEA