Working Problem 2

Also, why doesn't that function work??