Reimplemented nest again, better. Code is shitty.