Edited the MasterClass.java to have comments and contracts explaining what the code does.