more bug fix
organized code base; store attribute as declared order