Put some functionality in barneshut in different functions
and reimplemented massopt