Database code working

sweeet