added and tested weighted alignment