Cleaning up whitelist function, and adding ssh support