Adding algorithm for adding blocks from a txt file