Added .cpp showing core idea