adding properties and optimazing code