patrick code translated needs work