fix rounding issue and add flexible layouts
update README and licence to LGPLv3