algorithm
delete unsueful code