cleans DB code and fixes #3 by adding button