moving needle in seperate file, creating sparsediagmatrix
successfull refactoring