Memory Optimizations

changes:
- Memory now uses proper primitive data types
  using less overall memory and increasing performance