Switched to use Buffer, grouped variables by type, removed commented
code