bug fixes and changes to align stuff