some changes, still needs improvement