Creating the spawn_interval function for easy greenlet repetition
Handling division errors in result calculation
Added a couple comments