better implementation/ more flog