improved some coding
major update #1