changed stats file to use numpy instead of manual loops _NOT_TESTED_YET_
check if filepath is ok