Added landscape mode. Removed NullPointerException bug if database is empty