Modified to lab assignment specifications.