basic working version
under dev
in progress
changing to scipy functions