got solution down to 0.5 seconds