Deleted some global vars and changed buffer to memory, #53

Signed-off-by: Sven Haardiek <Sven@Haardiek.de>