tested the function to chapter seven