Scala practice. Compression.