Code tweaks

- Don't make code reference readonly.
Added comments
Code tweaks