Dry-coded algorithm for forest filling