Make many elements static and/or final that can be
Use foreach syntax where applicable
Use Java-style array declaration
Cache sqrt(2)