problem 20
problem 21
problem 22
moved sigma function to utils, cleaned up utils some
problem 23, fixed bug in sigma function