code update

I started cleaning up the code a bit. got carried away. ;)