Commented code and fixed some issues, Still crashes sometimes in swaplevelbuffers at the memcpy, unknown reason