removed redundant stuff. fixed trap