Added properties and retrieval to database. Needs some cleaning and refining.