Added simple logic for opening file