fix bug with recursion
remove unused files