Fixed bugg in allowedPosition and gave X coordinate preference