Code cleanup
Stabalizing code