Finish the logic