Initial code
Add minor fixes. Simulate one row only