full logic added