add random fraction and matrix generation