Rambar optimizations --Thx to AOKP