mergefix from nicks stuff
remove useless function