Quick solution to segm fault at generate Move Home actions.
Arrange it more efficiently