more fixes, working version 1