logging and javadoc improved and code made simpler
variable renamed to make the difference between misleading userid parameter and ID of user clearer
notes added about parameter userid
optional properties added