add in switchJava func