added decrypt function and commenting