Initial solution (before guards)
Slight improvement & added time_test