Improved implementation

Still not done though...