sql queries in epuss.sql extended and corrected