Your code is hard to understand, what's it supposed to do?