Base functionality almost finished.