minor bugs removed
header bug removed
refactoring and improvement