New random chest algorithm

Rewrote the chest algorithm. Looks working in my local tests.

Signed-off-by: William Lebel <lebelwilliam@gmail.com>