updated to current version
fixed margin handling