Adds more statistical tools

Also fixes some variable errors and some dependency errors