next step
nearly working version