main functionalities; UNTESTED!