adjusted logic