refactor working except hieghtmap update