Fix #19,#20;#13 in progress;support for over 1000 slots