Random rotation was not performed on the structure. Now it does.
Added crop and minimal_size methods, plus added comments and made code nicer