How do I remove the errors in the following code: