Added comments for clarity

added some comments for clarity of code. Also modified the setValue
setter in Trait.java