Fixed numericals on exercise 48
Cleaned up exercise 48, got rid of redundant functions