working code

requirements completed - need to make it meet the security parameters.