some big changes.. it now handles dynamic creation and deletion of folders