Added database queries to improve layout and functionality of app.