Added function to work without files