move part of linear algebra to data types and add Java/Python examples