Added init file, reorganized code