switched to call

plus bugfixes and cleanup