adding logical functionality