added generation of the 4 optimal rotation matrices