Major changes to turn it into dataminer

Many new functions added. comments need to be done, the last line
disapearing needs to be fixed.