added tests and built rewards architecture