Updated code samples in the readme file
Small perf improvement