Wrote terminal test function