first working code with environment and alignment results