full logic