feature addtions, code improvements.
minor clean up for future code