not working list to matrix conversion