added lörus input
replaced clumsy filehandling with resourcestreams.