Added code to provide normal attributes, and did some minor clean-up