Memory management

Just made it more memory efficient a little