Modified so it can run from a jar