merged alex code