Practicing common algorithm