refactored filtered ls solution and used path module