minor bugfixes and a new user function