moved scrypt into it's own function since jshint doesn't seem to work inside closures