Did some hacks to original code