Restructured Cubeshaft.java (Main class)