initial code design attempt