Code clean up
Begins to work