fixed bug with file location
small cleanup
added database structure