change code format, added licence header for new file. removed unused variables.