updated resize and clicking functions