the code is all over the place