Added package, import directives and many fixes