adding theory and mysql connection code