got all the code working with reflection and all that