first approach to big o code
it doesn't work yet