Import Costik's rawbg stuff