big diff, small tweaks
re-introducing alig + code style cleaning