Basic functions implementation. Interface almost finished.