Main functionality completed.