Remove unused variables
Cleanup and add licence headers