We did this in class for Java