encrypt funtion almost works