removed redundant stuff
removed nesting