use MAX_BONES variable consistently