Updated to an object-based implimentation