fixed energy views and tested sqlite3