Attempted quesiton 3
Fixed errors in question3