add notes about algorithm