Added factorial and exponentation algorithms