First commit. Code taken from distance.java and rectangle.java