fix bugs causing problems when lw stall, fix sw, and add input data for testing.