Changed mappings to global (aesthetic, variables were global before anyway), and changed bufferdelete to bd