Solve #6. Modifications added for generic/miniboxed implementations. Results seem to be good