now accepts URL parameter & solves #9; refactorization; minor fixes