some changes
fixed positions on and off
fixed on and off, better approach for K>1