code improvements and fixed prob# map bug

- changed to ===
- reduced code