Banana-Shaped: Optimized CPU usage

Optimized CPU usage. The code is optimized to reduce the average CPU usage from 20% to 0.1%.