Added avg and pow functions