updates to thread calculations
updates to thread calculations

- use multiple return statements instead of updating a local variable
- clean up comments
- increase max thread count to 150

learningequality/kolibri,mrpau/kolibri,learningequality/kolibri,learningequality/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,lyw07/kolibri,mrpau/kolibri,lyw07/kolibri,indirectlylit/kolibri,mrpau/kolibri,mrpau/kolibri,learningequality/kolibri,lyw07/kolibri,lyw07/kolibri,indirectlylit/kolibri