fixes #2: complete main functionalities