fixed bugs in entries made to database; cleaned up stuff