Added event listener for container resize + fixed some variable naming