added more functionality, mainly matrix creation from stdin