Final optimised version

Nothing better at all... :(