Added in statistical functions
Fixed conflicts and merged with Tyler