fixed bugs and added small features
added database.php