maybe using the length instead of l?