WORKING CODE + DB