removed all the extra stuff not related to issue #38. fixed up the log-and-return-empty-logic on line 36 per jonafato and dirns suggestions