fixed segfault
improved eigen