added more elements to DB and cleaned up code