some modification to db, added ploting