edit library.cpp
moved data and nr to global allocation
made random decomposition + classification (low variance)