Fixing it up so it runs properly