added accepts nested attributes and several other improvements