logic final