Added password protection and code clean-up.