fixed bugs

now good for generating 1 sample plane