Java Pictionary implementation