More practice with random class, defining functions, and decomposition