Chunk choice and a little refactoring.

Little variables renaming. Little line formating.