finished logic for adding classes and packages. though it needs tests