optimised some but would still take over 5 hours