added support for attributes and more tests