main logic is done