-p without a dot interpreted as facility, renamed some vars
added tests