Cleanup,better code

Easier to understand code.
Bigger Buffer
cleaned up a bit